package com.bizframework.springhb.support;

import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.DataSource;

public abstract class BaseMultiDataSource implements DataSource {

	public BaseMultiDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}

	private DataSource dataSource = null;

	public DataSource getDataSource() {
		return this.dataSource;
	}

	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}

	public Connection getConnection() throws SQLException {
		return getDataSource().getConnection();
	}

	public Connection getConnection(String username, String password)
			throws SQLException {
		return this.getDataSource().getConnection(username, password);
	}

	public PrintWriter getLogWriter() throws SQLException {
		return this.getDataSource().getLogWriter();
	}

	public int getLoginTimeout() throws SQLException {
		return this.getDataSource().getLoginTimeout();
	}

	public void setLogWriter(PrintWriter out) throws SQLException {
		this.setLogWriter(out);
	}

	public void setLoginTimeout(int seconds) throws SQLException {
		this.setLoginTimeout(seconds);
	}
}